package cn.sf.sufingadminconsumer.service;

import cn.sf.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "sufing-admin-provider")
public interface AdminService {

  @RequestMapping("/selectAdminInfoById")
  public List<User> selectAdminInfoById(@RequestParam("userRole") long userRole);

  @RequestMapping("/selectAdminInfoByType")
  public List<User> selectAdminInfoByType(@RequestParam("roleType") long roleType);

  @RequestMapping("/selectAdminInfoByEmail")
  public List<User> selectAdminInfoByEmail(@RequestParam("email") String email);

  @RequestMapping("/selectAdminInfoByPhone")
  public List<User> selectAdminInfoByPhone(@RequestParam("phone") long phone);

  @RequestMapping("/updateAdminInfoByUserId")
  public int updateAdminInfoByUserId(@RequestBody User user);

  @RequestMapping("/insertAdminInfo")
  public int insertAdminInfo(@RequestBody User user);

  @RequestMapping("/deleteAdminByUserId")
  public int deleteAdminByUserId(@RequestParam("userId") long userId);
}
